using Microsoft.Practices.Unity;

namespace Infrastructure.IocContainer
{
    internal class UnityContainer : IContainer
    {
        private static readonly IUnityContainer Container = new Microsoft.Practices.Unity.UnityContainer();

        public T Resolve<T>()
        {
            return Container.Resolve<T>();
        }

        public T Resolve<T>(string key)
        {
            return Container.Resolve<T>(key);
        }

        public void RegisterType<T, R>() where R : T
        {
            Container.RegisterType<T, R>();
        }

        public void RegisterType<T, R>(string key) where R : T
        {
            Container.RegisterType<T, R>(key);
        }
    }
}